from typing import Optional

from sqlmodel import Field, Session, SQLModel, create_engine,select
engine = create_engine(,connect_args={"user": "wechat_vote0", "password": "wechat_vote@2022", "database": "shen_dian_xin", "charset": "utf8mb4"})


class PreCommonWord(SQLModel, table=True):
    __tablename__ = "pre_common_word"

    id: Optional[int] = Field(default=None, primary_key=True)
    admin: str
    find:str
    replacement:str
    extra:str
    type:int

def get_words():
    with Session(engine) as session:
        words = session.exec(PreCommonWord).all()
        return words
    
